<?php
/**
 *
 * @author nhan
 *
 */
class Model_User extends Model_AbstractModel{
	private $name;
	private $username;
	private $password;
	private $privateToken;
	private $token;
	private $status;
	private $right;

	public function __construct($data) {
		parent::__construct($data);
		if (is_array ( $data )) {

			if (isset ( $data ['name'] )) {
				$this->name = $data ['name'];
			}

			if (isset ( $data ['username'] )) {
				$this->username = $data ['username'];
			}

			if (isset ( $data ['password'] )) {
				$this->password = $data ['password'];
			}

			if (isset ( $data ['privateToken'] )) {
				$this->privateToken = $data ['privateToken'];
			}

			if (isset ( $data ['token'] )) {
				$this->token = $data ['token'];
			}

			if (isset ( $data ['status'] )) {
				$this->status = $data ['status'];
			}

			if (isset ( $data ['right'] )) {
				$this->right = $data ['right'];
			}
		}
	}

	/**
	 * (non-PHPdoc)
	 * @see Model_AbstractModel::toArray()
	 */
	public function toArray() {
		$arr = parent::toArray();
		$arr['name'] = $this->name;
		$arr['username'] = $this->username;
		$arr['password'] = $this->password;
		$arr['privateToken'] = $this->privateToken;
		$arr['token'] = $this->token;
		$arr['status'] = $this->status;
		$arr['name'] = $this->name;
		$arr['right'] = $this->right;
		return $arr;
	}

	public function getName(){
		return $this->name;
	}

	public function setName($name){
		$this->name = $name;
	}

	public function getUsername(){
		return $this->username;
	}

	public function setUsername($username){
		$this->username = $username;
	}

	public function getPassword(){
		return $this->password;
	}

	public function setPassword($password){
		$this->password = $password;
	}

	public function getPrivateToken(){
		return $this->privateToken;
	}

	public function setPrivateToken($privateToken){
		$this->privateToken = $privateToken;
	}

	public function getToken(){
		return $this->token;
	}

	public function setToken($token){
		$this->token = $token;
	}

	public function getStatus(){
		return $this->status;
	}

	public function setStatus($status){
		$this->status = $status;
	}

	public function getRight(){
		return $this->right;
	}

	public function setRight($right){
		$this->right = $right;
	}



}